

section .data
msgBegin db 10,'--Program Begin--',10
msgBeginlen equ $-msgBegin

msgEnd   db 10,'--Program  End--!',0ah
msgEndlen equ $-msgEnd

d

sys_write	equ	4
stdin_fd	equ	0	
stdout_fd	equ 1
stderr_fd	equ	2


sys_exist	equ 1

section .bss
outBuffer resb 10



section .text
global _start



_start:

	
	mov eax,sys_write 			;system invoke funtion, sys_write(unsigned int fd, const char* p, size_t count)
	mov	ebx,stdout_fd 			;first param, fd, stdout:1, stdin:0  stderr:2
	mov ecx,msgBegin  	;second param, string's point to display
	mov edx,msgBeginlen	;string length
	int 80h				;interrupt invoke system function
	
	
	
;loop test , 2^n=?
	mov eax,36h
	mov ecx,1
sum:inc eax
	loop sum
	
	

	
	mov ecx,35h
	mov [outBuffer],ecx
	mov ecx,eax
	mov [outBuffer+1],ecx
	mov ecx,outBuffer
	mov edx,10
	mov eax,sys_write
	mov	ebx,stdout_fd
	int 80h
	
	
	mov eax,sys_write
	mov	ebx,stdout_fd
	mov ecx,msgEnd
	mov edx,msgEndlen
	int 80h
	
	
	;exist function
	mov eax,sys_exist
	mov ebx,0 ;exist codes, no error so it is zero
	int 80h
	
